package com.my.cd.chain;

/**
 * 链结构具体处理者：总监处理者
 */
public class PresidentApprover extends Approver {

    public PresidentApprover(String name) {
        super(name + " President");
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getSum() >= 50000) {
            System.out.println("**This request id = " + request.getId() + " ,money = " + request.getSum() + ", will be handled by " + this.name + " **");
        } else {
            nextApprover.processRequest(request);
        }
    }
}
